// login登录模块请求封装
const http = uni.$u.http;

// 获取base64验证码
export const getPicCode = () => {
	return http.get('/index.php?s=/api/captcha/image')
}

// 获取短信验证码
export const getMsgCode = data => {
	return http.post('/index.php?s=/api/captcha/sendSmsCaptcha', {
		form: {
			captchaCode: data.userCode,
			captchaKey: data.picKey,
			mobile: data.mobile
		}
	})
}

// 验证码登录
export const codeLogin = (data) => {
  return http.post('/index.php?s=/api/passport/login',
    {
      form: {
        ...data,
        isParty: false,
        partyData: {}
      }
    }
  )
}
